<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>提现记录</title>
<link rel="stylesheet" type="text/css" href="/style/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/xshop.css?ver=20170916" />
<link rel="stylesheet" type="text/css" href="/style/css/fu.shop.css"/>
<script src="/style/js/jquery-1.12.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/xShop.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/dev/js/mobiscroll.core-2.5.2.js" type="text/javascript"></script>
<script src="/style/dev/js/mobiscroll.core-2.5.2-zh.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/style/css/sweet-alert.css"/>
<link href="/style/dev/css/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
<link href="/style/dev/css/mobiscroll.animation-2.5.2.css" rel="stylesheet" type="text/css" />
<script src="/style/dev/js/mobiscroll.datetime-2.5.1.js" type="text/javascript"></script>
<script src="/style/dev/js/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>
<script src="/style/js/sweet-alert.min.js" type="text/javascript" charset="utf-8"></script>
<!-- S 可根据自己喜好引入样式风格文件 -->
<script src="/style/dev/js/mobiscroll.android-ics-2.5.2.js" type="text/javascript"></script>
<link href="/style/dev/css/mobiscroll.android-ics-2.5.2.css" rel="stylesheet" type="text/css" />
<!-- E 可根据自己喜好引入样式风格文件 -->
<style>
.datetimebox #search_btn {
    background: #f6b804;
    color: #fff;
    height: .6rem;
    line-height: .6rem;
    font-size: .28rem;
    outline: none;
    border: none;
    width: .9rem;
    cursor: pointer;
}
</style>
</head>
<body>
<div class="outwrap">
  <!--top-->	
	<!-- <div class="topbar clearfix topvh">
		<a href="/myshop/my_bag" class="btn-back">
			<i class="ico-back"></i><span>提现记录</span>
		</a>
	</div> -->
  <div class="in-mian2 pt88">
    <form  method="get" id="forms-id">
    <div class="fx-sort fx-sorttx present-record">
      <ul class="clearfix">
        <li class="_bag_type" data-type="1"><h3><a href="javascript:;">全部</a></h3></li>
        <li class="_bag_type" data-type="2"><h3><a href="javascript:;">时间<i class="ico"></i></a></h3>
         <div class="dropdown datetimebox">
            <div class="wrap clearfix">
                <label for="StartDate">日期</label>
                <input type="text" name="startDate" id="startDate" value="<?=$this->data['para']['startDate']?>"/>
                <label for="EndDate">至</label>
                <input type="text" name="endDate" id="endDate" value="<?=$this->data['para']['endDate']?>"/>
                <input type="button" value="确定" id="search_btn">
            </div>
          </div>
        </li>
      </ul>
    </div>
</form>
    <div class="txjlbx">
      <?php if(empty($this->data['para']['startDate']) && empty($this->data['para']['endDate'])) { ?> <h3 id="seach_time">本月</h3><?php }?></h3>
      <ul id="content">
      <?php
      if($this->data['data'])
      {
        foreach ($this->data['data'] as $v){

      ?>
      <li >
      <a href="detail?id=<?=$v['id']?>">
              <div class="info"><h2>
             <?= $v['withdraw_type'];?> 
           
              </h2><p><?=$v['create_time']?></p></div>
              <div class="opr">
                <span class="money"><b><?=$v['money']?></b></span>
                <?=$v['stat'] ;?>
               
               
        </em>
      </div>
      </a>
      </li>
      <?php
        }
      }
      ?>
       </ul>
    </div>

  </div>
</div>

<!--底部导航-->
<!--  
<div class="foot-menu">
    <ul class="clearfix">
        <li><a href="/"><i class="ico-7"></i><span>首页</span></a></li>
        <li><a href="/rcm"><i class="ico-1"></i><span>商城</span></a></li>
        <li><a href="/cart/cart"><i class="ico-5"></i><span>购物车</span></a></li>        
        <li class="on"><a href="/user/index"><i class="ico-4"></i><span>我的</span></a></li>     
    </ul>
</div>-->

  <script type="text/javascript">
        $(function () {
      var currYear = (new Date()).getFullYear();  
      var opt={};
      opt.date = {preset : 'date'};
      
      opt.datetime = {preset : 'datetime'};
      opt.time = {preset : 'time'};
      opt.default = {
        theme: 'android-ics light', //皮肤样式
            display: 'modal', //显示方式 
            mode: 'scroller', //日期选择模式
        lang:'zh',
            startYear:currYear - 10, //开始年份
            endYear:currYear + 10 //结束年份
      };

        $("#startDate").scroller('destroy').scroller($.extend(opt['date'], opt['default']));
        $("#endDate").scroller('destroy').scroller($.extend(opt['date'], opt['default']));
      
        /* $("#search_btn").click(function(){
           location.href="/wallet/detail?startDate="+$("#startDate").val()+"&endDate="+$("#endDate").val()

        }); */
        });
        $("._bag_type").click(function(){
			var ty = $(this).attr('data-type');
			
			
			if(ty==1){
				_bag_seach();
		    }else if(ty==2){
                    $('#search_btn').click(function(){
                    	var sub = true;
                    	if($('#startDate').val() ==''){
                    		
                    		swal("请选择开始时间");
                    		    sub = false;
                    		    return false;
                            }
                    	if($('#endDate').val() ==''){
                    		swal("请选择结束时间");
                    		sub = false;
                		    return false;
                         }
                    	   if(sub){
                    		   $('#seach_time').hide();
                    		   _bag_seach();  
                        	 }
                        })    

			   }

        })
        
        function _bag_seach()
        {
           
            $.ajax({type:'GET',url:"/wallet/detail?act=ajax",data:$('#forms-id').serialize(),dataType: "json", success: function(res) {
             	 //alert(JSON.stringify(res));return false;
                	
                
                 if(res.data.length >0){
                          var htmls = '';
                                                 
                       $.each(res.data,function(key,value){

                             htmls += '<li><a href="detail?id='+value.id+'"> <div class="info"><h2>'+value.withdraw_type+'</h2>';
                             htmls += '<p>'+value.create_time+'</p></div>';
                             htmls +='<div class="opr"><span class="money"><b>'+value.money+'</b></span>'+value.stat+'</em></div></a></li>';     
                                
                                
                         });
                          
                         $('#content').html(htmls);

                 
                      }else{
                    	  $('#content').html('');
                        }
                }
            });
        	
         }
    </script>
</body>
</html>
